package com.java.al.swing;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JToolBar;

public class JToolBarDome {

	public static void main(String[] args) {
		JToolBar bar = new JToolBar();
		JButton button1, button2, button3;
		button1 = new JButton("pre ");
		button2 = new JButton("next ");
		button3 = new JButton("end ");
		bar.add(button1);
		bar.add(button2);
		bar.add(button3);
		bar.setFloatable(false);
		JPanel panel = new JPanel();
		panel.setLayout(new FlowLayout(FlowLayout.LEFT));
		panel.add(bar);

		JMenuBar menuBar = new JMenuBar();
		JMenu menu = new JMenu("file ");
		JMenuItem exitMenuItem = new JMenuItem("退出 ");
		menu.add(exitMenuItem);
		menuBar.add(menu);

		JFrame frame = new JFrame();
		frame.setLayout(new BorderLayout());
		frame.setJMenuBar(menuBar);
		frame.add(panel, BorderLayout.NORTH);
		frame.setSize(300, 300);
		frame.setVisible(true);

	}

}
